Tried to impl,backtrack but not quite working