fixed bugs regarding non-square dimensions