Added easier to read formatting to c files and additional comments for clarification