added saving part of random sequence
rewrite constant to 'len' function