fix broken imports and code