remove dependencies on the standard c function
update doc