blockMin algorith, before debug