Improved sqr function

Because Roger looking at my code and stuff