fixed loopy stuff