added stdio include and fixed some syntax