Proof of concept implementation for complex numbers... not sure if this is any better, really.