code distributed properly, but not working