just use splice instead of this gymnastics