adding the horwitz code, and tidying things up~