hw4 changed param structure
added back parameter x