doctesting the code