Debugged input circular buffer. now working.