I was having problems with ufw not allowing me to add a new rule.
# ufw deny from 220.127.116.11 to any ERROR: initcaps [Errno 2] iptables: Chain already exists.
So this is what I did:
ufw disable iptables -F iptables -X ufw enable
And then I added the rule again
# ufw deny from 18.104.22.168 to any Rule added
With this command you can list rules by number
ufw status numbered
This is to delete a rule by number, taken from command above
ufw delete 8
Here is to insert a rule at the beginning
ufw insert 1 deny from [ip-to-block] to any