Merge Shmoo's changes back into Leafkiller's script