added array ends
removed last scanf