edited code, working on loading