IPL Mac finally works. Code is ugly as sin now though.