This is the clunky, non-optimized, loop-heavy version.