Working Version

This version has a working algorithm and updated functions.