This is code from Pampalk's thesis to be used for testing.