added semicolons where they needed to be, started adding more profitability checking