updated manually due to terminal issue, debugged code.