change paragraph handling to work with class