Updated to allow (and require) user to specify timeout