Fixed the simple tabulation code