Added enum and fixed some mistakes