first working version with gui