changed barrier to Edge and SKShape