Bug correction : speedup optimization