Magic numbers replaced by Enums and removed debug printing