Add function to get residue start and end