Made the second task a bit more accurate with long double but precision is not yet perfect