Main script now works and provides data for Rails app