changed quite a lot, added inputs/outputs, added patches