added in rendering code from the example mentioned in the last commit