Aldec's implementation