make stolen code more readable for me