windowController updated

Reordered some stuff and added some comments.