Struct arrays added and code cleaned