returns count, instead of printing output