refactor
got rid of pointers
added test
built in server