Update JS frontend to compute the level of fruit correctly