added for and while loops