Finally fixed negative value bug