Working clean version with smarter save.