updated the Usage and removed duplicate code