finished functionality and started writing tests