Merged and updated to Dana's changes