Done for class. Need to do xn calculations