fixing up dofit code more