number of items however the if statement used nIHeight (just the height of 1 item) and not nHeight (the height all the items).