get some basics working, need to write some unit tests