incorporated semantic analysis, fixed bugs