Implemented double buffering.

Signed-off-by: bcnjr5 <bcnjr5@gmail.com>