Efficiency of checking legality

Was parsing more integers than needed... Increasing the needed RAM by
roughly 1.5 times more than needed...
Linked to Enhancement #2