Implemented the O piece and refactored model.