Revert "Revert "working version""

This reverts commit 766890bb6836a2701efbc4dae26ea1f25666d7de.