Added example program and changed a few things