memory improvements

changed return type of int bodyContains to short bodyContains