fixed some linearization mistakes