got it in a mostly working state, file cleanup will come next