I was having problems with ufw not allowing me to add a new rule.
# ufw deny from 22.214.171.124 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 126.96.36.199 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