got working transmission code -- still slow and unpolished