Edge core algorithm part 1