Updated and added eject function