functions Square and Maximum