First version, loops not working yet.