final version tested with success