final version tested