typo in comment
added details to code adapted from foreign work