Removed unused variables and getListLength method