deleteLayer function

Deletes an existing layer