working version with minumum GUI