attempted to kill jitter. cleaned code and added comments