Rewrite of input and removal of testing setup