More inputs
Final working solution