This file could use some comments explaining what is going on.