Version 0.02  Made the loops much simpler