added more tests, broke out script into smaller functions, added test data