changing the mappgins from array to a big tree. It will be cleaner and easier to use now