fixed some bugs and added int/var stuff for missing data