Fixed small bug. Preparing for CG. Renamed w vars.