add compilation to Gillespie run script
proper memory freeing, style changes