Altered to provide toggle functionality.