Implemented all functionality.