git magic, thanks to woltage and darep