HW4.1 some modifications