Implemented code to pass tests