Updated working version.