error fixed, final version