moved stack pad computation