Added R interface
deleted some