refactored through Eliza's 1st commit Wednesday; pass tests