Main file contains all functions