finish ploting functions and cleanup unused function in main.c