modified according to suggestion