adds basic testing, refactors some thangs