resolved last issue by creating an array of key value pointers