Completed Array handling Logic, refactored code