Implement calculateKey