assignment5 improvement