added depth method, added pop from a certain point method
fixed merge