fixes #1 and fixes #2 and actually makes #4 work but we will want to make something more robust