first version
new way of defining the scrambler function
new way of defining the scrambler function
correct indexes