fixed profit_delta calculation and added spec