Improvements by @nulltask <- thank you VERY MUCH!