fixed a lot of memory issues and mapping bugs