Adding writelines to Controller class