added loadfile function