cleaned up R file, still some symbol errors