fix deal
add tests