remove redundant files
tie in client to main program
remove error flag & export fun