Cleaned up the mess I made trying to figure out how the callback functions worked.