modified according to suggestions