added delete code
reformatted code