original code, actually takes over 2 seconds less than previous commit