Some work on square recognition

- Implemented ordering for lines
- Corrected bug causing crash: it was an orrible unsigned integer overflow, thanks to Marcello for the help, finally you have repaid the help in the level of the laboratory of computer security xD
- the algorithm now runs only if there are vertical/horizontal lines to analize...