Fixed validation function

Validation function fixed issues, and reworked how main read in tokens
Finalized code/added comments