added some wiring, a lot of garbage code