Had some major mathematical issues but seems to be mostly working now. Still does not look right, perhaps weights are not being interpreted correctly