refactored sample data and input