improved parser using tokens and some other thing