Converting hard coded squares to math