corrected a few more things in shape detection