Fixed the orientation and changed the belief sudocode to real code