Add more comments here. It's not clear from the comment what this block of code does.