updated to basically final version