Implemented the required functions