Added new function for path finding and pushing