Modify find head function. Characters function in/out function