Completed 2nd algorithm & refactored. Collapsed modules.