correct calibration of device orientation (#5)
little fixes (made some variables local)
Merge pull request #6 from yvt/master

correct calibration of device orientation (fixes #5)