Moved timeout, added comment, general

Moved $timeout, added comment for this and fixed general appearance.