hw8 Computation methods