put things together add some tests