Move variable init inside loops
Change counter to uint8_t; fix start index
Add function to calc search space coverage