normal equation complete (+extra credit)