Added a fix for degenaracy resolution