New changes to Digital

Added a for loop and it works for any input given!