updated ex33 with some loops