modified according to your suggestion