correct calendar function