removed unused variable and method for data length