clean up and add offset