Reworked functions and if-else checkpoints.