implemented length/lengthSq func + tests