Fixed major bug in the lexing code, now it should also be more logical