added NaN test for check_square
added doc in code for check_square