General improvments, change function names and added several files