get it compiling and nearly working again