working version final v1.0