Updating. cleaning up errors and code