updated doxygen to be correct
fixing compiler warnings by pre-calculating the array length