edited for debugging