An apparatus comprising: a medical tool moveable to a desired orientation relative to a bone region for implantation of a medical implant; and an electronic orientation sensor transitionable between a first location fixed relative to the bone region of the patient and a second location on the medical tool; wherein, at the first location, the orientation sensor is adapted to record a reference orientation of the bone region of the patient, and, at the second location, the orientation sensor is adapted to determine an orientation of the medical tool relative to the reference orientation, wherein recording the reference orientation comprises measuring a gravity vector relative to the orientation sensor.