simpler solution to regparm problem