get working and add tests