added line up and stack functions