fix binary name, and add -Wextra
add headers
move declarations to top, make sure to use the appropriate type