changed the interface of functions