changed get_leng function declaration to return size_t rather than int to fix compiler error