changed method signature, comments, and logging