changed conversion of int to char and char to int using bitshifts, works fine