Fixing negative number bug