added wordcount++ in readinmadlib function