Added a brute force grid detection algo. GUI controls still need work