updated switch function, still need buttons