Update analyze

Replaced $1-$10 with variables to make code easier to follow