Added more tests and some business code