first working diff version, with test