Edit data.py

Added logic to data.py file