implemented minimal cost parse (untested)