Much easier implementation for 3.8