changes for new wiring + bug fixes