updated example code and changed keys --> key