Added code for inverting X axis