Working Program with tests