pre 1.1, optimized 1.0 code