Added array return to addProgrammaticallyToDb function