somewhat working ext code