Both functions working, still output has to be decided