Added comments and stuff

Fixed indentations and added comments.
By the way, who authored this class when it was first made? I just copy pasted most of it from MainThread.