Implemented all desired functions