added some comments, changed pin scan to bind time, some minor style cleanups