UI is simplified, added array boundary check (thanks to Valgrind)