Rewrote it in python instead.