removed duplicate build_seq function and revised the main function to properly use only build_seq