all function renamed, file structure improved