Fixed a bug in the reference point calculations
Added R-code for shiny package for website display