Added doxygen comments

Please review these and make sure they're correct. I haven't written the code, so I'm not 100% sure how all of it works.