made tile and drawmap function in one