Implemented the 2 functions