with some modifications to capfile