working... cleaned up source.