updated code for editing demographics