Fixed according to comments, improved success messages, removed redundant input check.