Refactored to allow testing, commiting before putting a testing method together.