updated with using collections instead of primitive vars