need to get loop working