Made all changes mentioned by david