Created auxiliary table 'profits' rather than computing profits on demand. Updated for Rails integration