the sort function has been complete! 
next step would be the filter function.
and the following is drag painting and full drag function