Implemented all functionality