merged a second version from gliders1