switched to lists to detect length