Fixed repeat option
Added enum
added more comments