correct prototypes
use const where possible