refactoring code
add card mode
fine tune
fine tune
fine tune
add contour class