Replaced algorithm to find userconstraints based on a skeleton with a new version. The new version takes branches into account and has a simpler structure.