more structure, added basic test