updated with defines and prototypes