Changed some stuff in the main function to accept arguments instead