Formatting (uncrustify file here: https://gist.github.com/Bloomy/5705746)