updated main.f90 to include dynamic allocation