Change while(1)
Add prototype