Functions and code used in the project