Code Cleanup

Cleaned up code, and made example a bit prettier.