Implement helper functions and main algorithm
Merge branch 'master' of https://github.com/CST466/Homework1