One of the most important problems of coding theory is to construct codes with best possible minimum distances. In this paper, we generalize the method introduced by  and obtain new codes which improve the best known minimum distance bounds of some linear codes. We have found a new linear ternary code and 8 new linear codes over F-5 with improved minimum distances. First we introduce a generalized version of Gray map, then we give definition of quasi cyclic codes and introduce nearly quasi cyclic codes. Next, we give the parameters of new codes with their generator matrices. Finally, we have included two tables which give Hamming weight enumerators of these new codes.