added -w, -i & -t flags. Changed -c output to group together