fix dictionary order bug and update examples