Added better example page, lots of bug fixes