added all essential files, preliminary attempts to get the cost right