some scaling algorithm that doesn't really work