Speed improvments + bug fix on end of fold detection + zx and zX updated for the plugin