updated working version 2.0