removed most comments except in scheme_optimized_val