added support.R for supporting functions