Modified code to work if it has elements larger than it.
Crash fix.