fixed untested code...