Adding preliminary shape detection code