changes to make it compile after f90 conversion. Now compiles