         o        = ($ el).data '_obj', {}
         _this    = this
         metadata = ($ el).data "#{ pluginName.toLowerCase() }-options"
+        stateKey = "#{ pluginName.toLowerCase() }-state"
 
         resize =
             main: (e) ->

                _.each resize, (v, i) ->
                    resize[i] = _.debounce(v, o.opts.debounceTime) if $.isFunction(v)

            o.el.data "#{ pluginName.toLowerCase() }-state", 'decompressed'

            o.el.on "compress.#{ pluginName }", (e) ->
                current = $ this
                state   = current.data "#{ pluginName.toLowerCase() }-state"

                current.data "#{ pluginName.toLowerCase() }-state", 'compressed'

                o.opts.onAfterCompress(_this) if $.isFunction(o.opts.onAfterCompress)

                console.log 'compressed'

            o.el.on "decompress.#{ pluginName }", (e) ->
                current = $ this
                state   = current.data "#{ pluginName.toLowerCase() }-state"

                current.data "#{ pluginName.toLowerCase() }-state", 'decompressed'

                o.opts.onAfterDecompress(_this) if $.isFunction(o.opts.onAfterDecompress)

                console.log 'decompressed'

            ($ window)
                .on("resize.#{ pluginName }", resize.main)

            # execute custom code after the plugin has loaded
            o.opts.onAfterLoad(_this) if $.isFunction(o.opts.onAfterLoad)

        _this.getState = ->
            state = o.el.data stateKey

            return if typeof state is "undefined" then 'decompressed' else state

        _this.isCompressed = ->
            return if _this.getState() is 'compressed' then true else false

        _this.destroy = ->
            o.opts.onDestroy(_this) if $.isFunction(o.opts.onDestroy)

