made a bunch of changes, haven't tested. fingers crossed.