right answer now, but the speed needs to be improved