Improved Algorithm

Version 1 - 6/28