updated inputs and code