Start towards using acceleromters properly
updated and cleaned