Implemented all required features
Some cleanup