Added support for non square maps