So weird to implement my own while loop