fixed odd and even fucntion bugs