working version proc/clock, but not perfect yet