Algorithm Updated 7/7/14