forked from loathingkernel and ported to windows