(Algorithms1, week3) Final bug fixes for 100% score