Added init and delete for function