made major overhauls based on feedback fro Thumbtack and abstracted much of the logic to pass in functions