Giant work in progress, totally broken, but almost there...