started modifying for loops derivation