Algorithm implemented on the main screen. Outputs to console