Make calculateX a private method