Moved main function to Driver; made a universal add function