Cleaned up comments and moved a code snippet out of Control to a temp file