working version of the programm