Finished the computation and added result output.