Fixing printing problems and adding define functions