added list length initialization