Simplify and fixed some errors in y-axis derivation