Toggle Function

Added more controls and wrote a toggle function.