Adding some doc blocks
Adding formatting option
Small formatting
Code organisation
Breaking up getNewBaseName function in half