mostly working now, I think