Fixed bug in setParameters and added a print(parameters) function for debugging.