cleaned up. should be stable