Added some bits of code. It is now working!