Added while, and a lot of stuff