fix outOfArray-bug in dictmodel + some code cleanup
code cleanup
fix dictionarybug