Made structure and added some functions