cleaned up the framework a bit, fixed some syntax