patched all the code together, now runs end to end