Changed parameters to locals