adding count parameter. closes #3