gave all vars meaningful names; fixed copyrights