Works on examples correctly