Pretty much done, now must refactor