Made a lib file for functions