refactor and fix bug. remove num 4 from result