Implemented functions correctly.