Fixed some copy paste code
Added files function