Changed file structure, added introduction to functions