edited for readability