Implemented memory instructions and cleaned up some register issues