Fixed formatting and fixed the square function on doubles