Minor change to make it more functional and less pseudo-codey