added unit tests and writing it using TDD now