major update, mostly working