Fixed code to accept string as input and implement interface