cleanup code
correct modifiers a nd prototypes