Removed for-loop and replaced with array-method, added comments