removed unneccessary code, changed parameters