Created main piece of code