Added reshape commands to make sure stuff is in the right orientation