Final version 0.9, submitted to CRAN