added grid and brute force calculations