fixed return as type int for residue ids