Added junit for test and made better key id.