Changed into allocatable arrays, created variables for internal storage