new version modified according to issues (to be verified)