Fixing bugs and wiring up the UI