only loop once through data
simplify