restoring unfinished code