working version before going down to 1 input box