minor edits to get it all to work