minor changes to signature and small bug fix