1) hard coded the i as suggested by cbhl