Edited conditions for possible user error, updated decision tree, cleaned up loop function, arranged code to be more readable and semantic.