refactored to use streams! so fun.