Added orientation sensor and movement code.