Changing dynamic loading to not allocat memory until needed