algo2 week1 refined