format fixes; remove unused variables