various changes to make it compile