Initial code with unit tests