Merging Dan's changes