moved treasure function