Fixed for loops; Added constants