added remove method to allow removing elements from index