Added functions for testing to main.c and primary files

Adde one function for testing to each of primary files and added the
invoke of them to main.c