before merging with nithin's code