removed warnings, rustified some code