added previous items count parameter