fixing up based on tests