Added parameter to control number of lines