fix bug and added orientation for cubes