Hm, you dropped the old "default" case where it returned -1. Not sure if there was any use for that though.