added thanks to Charles where thanks are due