Added a better example and fixed some old code not working