added changes from branch: old-version, TODO: check if everything works