Try to find formula to replace a magic number

More work on this is still needed.