backup before big update

-making things more managble and portbale.
- diff files with functions in headers and c files