COMPILES; fixed some incorrect variable references; built