cleaning up on the fly code from a couple commits ago. mostly just adding comments