check for index validity
add closing parentesis in toString
put sqrt inside summation