homework 1 for 256A (ring mod needs update)