Mostly working
Minor revision