updated with switches