switched to using streams