put flip card functionality into its own file