Implemented all the changes as suggested by bitiotic.