Implemented the rest of the instructions and tests