some helpful codes