updated arrays and fixed call by val in basic.