Added some map drawing math