Set timeout to 2, review some comments.
Made timeout configurable, reviewed some comments.