cleaned up cardcurlers write and read functions