Implemented all the functionality required. Improved design