partially fixes #172
fixes #178
fixes #176
fixes #225
clean up