Credits to 90e and DarKobalt for original mod, credits to a particular reddit user for the updated code.