Changed datastructures to use associative objects instead of arrays