first version (names of functions are in czech, I will change it later)