Refactor digits

Split the chars and map it to int