properly remove elements from array
Merge pull request #2 from c301/master

properly remove elements from array