bunch of changes, but this is broken atm