First version
Removed enum type, now works