Implemented buffer for on-screen rendering algorithm.

Fixes #13