Updated to work with unit tests