added enum library and changed code accordingly