fixes to pins, code changes