added comments to core.rs and rustified code a bit more