merged old 1.0 and 1.1 code