Write tests

see #2