Pretty close; needs some testing