fixed rotation issue, added accelerometer support