minor modifications for speedup