Implemented TODOs. Should be all set to submit.