refactored squares and gigasecond