final version fixed