Feature/regulation

Tested and debugged Nathan's code.