hw7.sml modified