Updates

split into separate R files