update with unit tests