working version for demo