Added motion sensor bits. Cleaned up overall.