code is modular, same results as before, faster