Almost done, need to refactor tests