Reformatted the objectmap and made the code easier to read