added load function to main class