used for solving stat 400 problem