modified according to coding styles