added delete by key function and test