Added comments, flipped the order of the sign / no sign conditional so it's easier to follow, other minor clean-ups
Updated doc