Added timeout argument. Closes #5