Math 504 Code