removal of debug statements and optimisation of vector append calls in inputstream