Streamlined functions and connection to csv file