fix map bugs and make map drawing