first commit with unit tests working and covering most of the functionality