Edited comment and added performance improvement.