Moved allocation of previous to 'global_allocate' subroutine and finished preparing structure in main.