make flags and new cost functions added