added test. added hasKey function.