brainkey implementation