changed BED counter to be usable from the terminal with arguments