Added codes that add and check check_sum.