Fixing the bug which prevented cin from working correctly