Using abali96's commit submitted on June 27th/28th as a base, I've made changes to enhance its functionality