update more elegent solution