restoring old codebase

TODO: figure out SQL tables needed for operation