some changes
refactor in to separate functions
make class Clip