improving syntax. will try for-loop next