Got homework working; still need to understand it better.