Could you post compilable versions for both approaches, so that we can test it our self? I guess one would also need some input data.