Added while-loops and for-loops