Change profit calculation to occur only when selling