Add expressions to get the map width and height
Remove some useless code