faster code, it seems