please add a comment describing what this macro-from-hell is doing and what each parameter is for