made a start at adding tests
fix ordering