adding tests and code as it were when it was split up