Move parser works but getting errors

move parser checks legality but getting errors on every move entered. I
think a function that is called in the is_legal functions is not
correctly implemented