Added cure and fixed bugs