Made the methods running, but there is a big risk of wrongly synchronized scalar variables