fixed function names
updated and added license information