Commiting Bug2 algo changes
Bug 2 algorithm