finished the computation part