corrected >> function