fixed line counter; moved splicing the array until after all the indexs are found since it's possible to get a index which doesn't exist if you do it beforehand;
updated readme