changing to pop method