Did not write this code but did modify a few things in this method for our use. Will change the comment.