Added the -d option to get descriptive output. Some refactoring was done too.