Codes for the extra credit