Added functions + _test.R