finished script for a7