added initilaizations and set the output