Making bugfixes
Merge branch 'master' into r2
Merged from master and added more functions
Merging from r2 & r2_new into master