mostly cleaned up