Added load level function to main