fixed error: label at end of compound statement
fixed malloc redefined
fixed static variable
Code still needs checking for warnings