Major bug fixing

also a bit of grammar fixing