More progress. Committing before refactor.
more stuff