Improved Solution