simplification of P26.hs