added console script and unit tests