Added R Compilation + BugFixes