Remove duplicate references
Remove unnecessary headers for constistency
Improve doc string and variable names
Use consistent input and output dtype, remove duplicate doc string parts