Great improvement in motion of pencil with accelerometer

movement improvement plus some some refactorings