Deleting code in main.c and moving it to implentation