better solution to solve last commit