scan and groove implementation