more improvements and fixes in the update function
changed filtered to take an optional callback (for backwards compatibility) and returned an array with the filtered items
added missing semicolon