Divided into functions (+ added display func)