some changes requested by @0xAX #60