updated data class and main function