parameters for pop method and other fixes