Written mostly by HotKeyIt, storing for reference