setting height based on number of elements to show