Final scrolling version of C code