refactor class number regexs to be the same, allow for section letter at the end
save pwd earlier to avoid shelling out twice