Added backprinting and foreprinting