Originally made by me, and code fixes by Steve