added delete() method, bugfix for index incrementing