Working Algorithm, forgot to commit final