Minor changes to adapt to westgrid
Revised code