Added cave generator logic