make 0 and 1 const and use switch