bug fig to duplicate location algorithm