added rev4 with tilt sensing w/ averaging