Adapted for Blakecoin.