added code and extended material to ICML paper