More robust warmup function