Added linear and rotation loop

Also added comments for doxygen
Merge branch 'working'