almost ready for updating.

re-did a lot of the code so it functions in a more "d3" fashion