Added is_valid_inputs