Format input and output better