two solutions for remove element. Not know why RunTimeError is there