merged Rich's code to get his plugin for class demo