middle end stuff