moved int attributes to method variables in square algos