updated
tweaking docs & code, fixed factor problem in data.frame indexing