Using shared sequenece lib to simplify function