fix C89 mistakes
added timings to both impls, C is 8x faster