complete version working