Added input and conditions