Fixed tabulate, added (broken) $$ declarations