Re-written to generate unique flanks using new mapping method
Bug fix from last checkin