Code finally works