Finishing touch for the main script & sample implementation from kdamball.com