Implemented some of matt & ben's changes.