handle broken input
reduce loop iterations for better performance
symbol table to reduce memory consumption