Fixed class selection component

Issue in dertermineID function where we weren't taking into account of the possibility of a array larger than 2