Added code to collapse inputs