Magnets have many important uses in everyday life. They are used in compasses to direct the needle to magnetic north. Trains called maglev trains use powerful electromagnets to float above the track and propel the train at over 300 miles per hour. Inside vending machines, magnets help sort real coins from fakes by detecting metal composition. Magnets are also commonly used to hold objects like photos on refrigerators and to keep refrigerator doors closed. Electric motors and generators function using magnets to create motion and generate electricity through magnetic fields.