clean up code, change to toggle