Update

removed duped code, fixed bug