Changed enum type to int. Added readline.