added function declarations
Fixed constant and labels issues