Initial commit. Mostly working, require a small changes in handling missing values