first verstion with unit tests