Added initialisation for state and input