clean up test and make num keys more flexible