rework ast generation code and evalutation