more merging from ashton's branch