made the time out length a variable instead of hardcoded