implement continous constant calculate optimize