modifying to fix some issues