added delete functionality, restructured initialization process