removed ready() method, added line to close input buffer after reading