removed all the arrays going on and mereged it into a single dict and added a lot of little helper functions