Code Tidy

Removed unused lines
Added note about where the algorithm came from