patched a bug when sps = 0 and added default output on /dev/stdout