algorithm program 2 finished!