finished main implementation. ear decomposition is not OPEN yet. need to add extra sorting step therefore.