added length variable input