Implemented Hidden Squares algorithm