Added functionality to render method and a renderer class for foreground
and background.