reviewed code and changed code and now code is better than before