separated functions into differnet files
merged